<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let input = `3
        737270
        737272
        737288`

        let Si_list = input.split('\n').map((v, i) => {
            v = parseInt(v.trim())
            if (i > 0) {
                let t = v % 512
                if (t) {
                    v = v - t + 512
                }
                return v
            }else{
                return v
            }
        })

        let N = Si_list[0]
        Si_list.shift()
        Si_list.sort((a,b)=>b-a)
        const pan=1474560
        let max=0
        let zhan=[]
        
        

        console.log(N, Si_list);

    </script>
</body>

</html>